import { request } from '@/api/request'

// 获取政务云列表
export function getGovServiceList(params) {
  return request({
    url: '/system/gov/userBelongToList',
    method: 'get',
    params
  })
}

// 获取财务统计
export function getStatistics(params) {
  return request({
    url: '/system/gov/statistics',
    method: 'get',
    params
  })
}

// 获取政务云列表
export function getMarketServiceList(params) {
  return request({
    url: '/system/market/userBelongToList',
    method: 'get',
    params
  })
}

// 开机
export function openServers(data) {
  return request({
    url: '/cloud/control/batchStartServers',
    method: 'post',
    data
  })
}

// 关机
export function closeServers(data) {
  return request({
    url: '/cloud/control/batchStopServers',
    method: 'post',
    data
  })
}

// 重启
export function openServersAgain(data) {
  return request({
    url: '/cloud/control/batchRebootServers',
    method: 'post',
    data
  })
}

// 重置密码
export function resetPassword(data) {
  return request({
    url: '/cloud/control/batchResetServersPassword',
    method: 'post',
    data
  })
}

// 续费
export function renewalResources(data) {
  return request({
    url: '/cloud/control/renewalResources',
    method: 'post',
    data
  })
}

// 获取云服务器规格
export function specifications(data) {
  return request({
    url: '',
    method: 'post',
    data
  })
}

// 购买相同配置
export function buyAgain(cloudServersId) {
  return request({
    url: '/system/relation/buyAgain/' + cloudServersId,
    method: 'get',
  })
}

// 查询云服务器规格变更支持列表
export function listResizeFlavors(data) {
  return request({
    url: '/cloud/listResizeFlavors',
    method: 'post',
    data
  })
}

// 变更-查询价格
export function resizeFlavorPrice(data) {
  return request({
    url: '/cloud/resizeFlavorPrice',
    method: 'post',
    data
  })
}

// 重装弹性云服务器操作系统
export function reinstallServerWithCloudInit(data) {
  return request({
    url: '/cloud/control/reinstallServerWithCloudInit',
    method: 'post',
    data
  })
}

// 切换弹性云服务器操作系统
export function changeServerOsWithCloudInit(data) {
  return request({
    url: '/cloud/control/changeServerOsWithCloudInit',
    method: 'post',
    data
  })
}

// 查询镜像列表
export function glanceListImages(data) {
  return request({
    url: '/cloud/glanceListImages',
    method: 'post',
    data
  })
}

// 远程登录
export function showServerRemoteConsole(data) {
  return request({
    url: '/cloud/control/showServerRemoteConsole',
    method: 'post',
    data
  })
}

// 安全组列表
export function safeGroupsList(data) {
  return request({
    url: '/cloud/security/neutronListSecurityGroups',
    method: 'post',
    data
  })
}

// 删除安全组
export function delSafeGroups(data) {
  return request({
    url: '/cloud/security/neutronDeleteSecurityGroup',
    method: 'post',
    data
  })
}

// 查询安全组规则列表
export function safeRulesGroups(data) {
  return request({
    url: '/cloud/security/neutronListSecurityGroupRules',
    method: 'post',
    data
  })
}

// 删除安全组规则
export function delSafeRulesGroups(data) {
  return request({
    url: '/cloud/security/neutronDeleteSecurityGroupRule',
    method: 'post',
    data
  })
}

// 创建安全组规则
export function addSafeRulesGroupsOne(data) {
  return request({
    url: '/cloud/security/neutronCreateSecurityGroupRule',
    method: 'post',
    data
  })
}

// 创建安全组规则
export function batchAddSafeRulesGroups(data) {
  return request({
    url: '/cloud/v3/batchCreateSecurityGroupRules',
    method: 'post',
    data
  })
}

// 获取区域列表
export function govAreaList(params) {
  return request({
    url: '/system/gov/area',
    method: 'get',
    params: params
  })
}

// 获取区域列表
export function changeRemark(params) {
  return request({
    url: '/system/relation/remark',
    method: 'put',
    data: params
  })
}